<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 
<%@ page import="org.jamwiki.model.*,org.jamwiki.utils.*" %>
<%@ include file="include.jsp"%>
<%
List userList = (List)request.getAttribute("items");
String title = session.getAttribute("title")+"";
String jump = session.getAttribute("jump")+"";
String category = request.getAttribute("category")+"";
String type = request.getParameter("type"); 
if(type==null)
	type="public";
String num = request.getParameter("num");
String offset = request.getParameter("offset");
int rowNum = 0;
if(null != offset && !"null".equalsIgnoreCase(offset) && !"".equals(offset)){
	rowNum = Integer.parseInt(offset);
} 

%>
<%@ include file="page-init.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	 <style type="text/css">
	 body{
	  width:100%;
	  height:100%;
	 }
	 </style>
	 <script type="text/javascript">
	    function addRole(id){
	    	openwindow("<%=request.getContextPath()%>/wiki/role.jsp?userId="+id,'500','260','');

	    }
	    function catalogManage(){ 
	       window.location.href="<%=request.getContextPath()%>/wiki/catalog.jsp";
	    }
	 </script>
	 
  </head>
  <body   leftmargin="0"  topmargin="0"  marginwidth="0" marginheight="0">
  <form name="searchForm" method="post" action="<jamwiki:link value="Special:Search" />">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="36" align="left" valign="bottom" background="<%=imagePath %>right-bg.gif">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="0" class="word-orange">&nbsp;</td>
                <td width="98%" align="left" class="word-orange">您所在位置： 
                <!--
                <td width="98%" align="left" class="word-orange">您所在位置：
                <!--
                <a href="/jamwiki" class="txt-blue"  target='_self' style="color:#e27e1b; ">Wiki首页 </a> &gt; 
                -->
                <a href="en/Special:Allpages" class="txt-blue"  target='_self' style="color:#e27e1b; ">系统管理</a> &gt; 
                <a href="<%=jump %>" style="color:#e27e1b; "><%if(title==null)out.print("授权管理");else out.print(title) ;%></a> </td>
              </tr>
           
		</table>
            </td>
        </tr>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="center"><img src="<%=imagePath %>right-line.gif" width="98%" height="9" /></td>
          </tr>
        </table>
        <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td></td>
          </tr>
        </table>
        <table width="98%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="2%" align="center">&nbsp;</td>
            <td width="9%" align="center">&nbsp;</td>
            <td width="2%" align="center">&nbsp;</td> 
            <td width="50%" align="right"><a href="<%=basePath %>en/Special:Allpages?type=public&num=<%=WikiUtil.percount %>&offset=0"   class="<%if("public".equals(type)){ %>txt-blue<%}else{ %><%} %>"><span style="font:bold">授权管理</span></a>&nbsp;  |  &nbsp;<a href="javaScript:catalogManage();" class="<%if("nonpublic".equals(type)){ %>txt-blue<%}else{ %><%} %>"><span style="font:bold">目录树管理</span></a></td>
          </tr>
        </table>  
        <table width="98%" height="8" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td></td>
          </tr>
        </table>
          <table width="98%"  border="0"  cellpadding="0" cellspacing="1" bgcolor="#dddddd">
          <tr > 
            <td width="5%" height="25" align="center"  class="table-title">序号</td>
            <td width="10%" align="center"  class="table-title">帐号</td>
            <td width="20%" align="center"  class="table-title">姓名</td>
            <td width="15%" align="center"  class="table-title">创建时间</td>
            <td width="30%" align="center"  class="table-title">操作</td> 
            
             
          </tr>
          <%if(null != userList && userList.size()>0){
        	  for(int i = 0;i< userList.size();i++){
        	      WikiUser t = (WikiUser)userList.get(i);
        	  %> 
          <tr class="<%if(i%2==0){ %>table-tr1<%}else{ %>table-tr2<%} %>">
            <td align="center" height="10"><%=rowNum+i+1 %></td>
            <td align="left"  ><%=t.getUsername() %></td>
            <td align="center"  ><%=t.getDisplayName() %></td>
            <td align="center"  ><%=t.getCreateDate() %></td> 
            <td align="center"><%if(t.getUserId() != 1) {%><a href="javaScript:onClick=addRole('<%=t.getUserId()%>')">授权</a><%}else{ %>授权<%} %> 
             
            
          </tr> 
          
          <%}}else{ %>
          <tr>
            <td colspan=6 align="center" bgcolor="#FFFFFF" >没有记录</td>
          </tr>
          
          <%} %>
        </table>
        <table width="98%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="4%" background="<%=imagePath %>right-pagebg.jpg">&nbsp;</td>
            <td width="96%" height="30" align="left" background="<%=imagePath %>right-pagebg.jpg"><jamwiki:pagination total="${itemCount}" rootUrl="${rootUrl}" /></td>
          </tr>
        </table>
  
  </form>
  </body>
</html>
